package com.view;

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;

public class FrameUtama extends JFrame {

    private JButton jb1, jb2;
    private JLabel jl;
    private ImageIcon myIcon = new ImageIcon("qrsbgnww.png");
    private JPanel jp;
    private JMenuBar bar;
    private JMenu menu,menuOption;
    private JMenuItem item,exit,help,about,dosen,sekretariat;

    public FrameUtama() {
        this.setTitle("FRAME UTAMA");
        this.setBounds(200, 100, 800, 600);
        this.setResizable(false);
        this.setVisible(true);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        JLabel j1=new JLabel(myIcon);
        j1.setSize(800, 600);
        this.add(j1);
        bar=new JMenuBar();
        menu=new JMenu("File");
        menuOption = new JMenu("Option");
        dosen=new JMenuItem("Dosen");
        dosen.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JDialog dialog = new JDialog();
                Dosen_view dc = new Dosen_view();
                dialog.setTitle("DOSEN");
                dialog.setSize(700, 500);
                dialog.setLocation(200, 100);
                dialog.setVisible(true);
                dialog.setResizable(true);
                dialog.add(dc);
            }
        });
        menu.add(dosen);
        sekretariat=new JMenuItem("Sekretariat");
        sekretariat.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JDialog dialog = new JDialog();
                Document_surat dc = new Document_surat();
                dialog.setTitle("SEKRETARIAT");
                dialog.setSize(700, 600);
                dialog.setLocation(200, 100);
                dialog.setVisible(true);
                dialog.setResizable(true);
                dialog.add(dc);
            }
        });
        menu.add(sekretariat);
        item=new JMenuItem("Exit");
        item.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.exit(3);
            }
        });
        bar.add(menu);
        bar.add(menuOption);
        menu.add(item);
        help = new JMenuItem("Help");
        about = new JMenuItem("About");
        about.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(null, "Kelompok 4 :\n1.Agustinus dimas fitriyanto (115314002)"
                        +"\n2.Emanuel prihmardoyo (115314054)\n3.Agatya kurniawan (115314095)"
                        + "\n4.Rika elsa oktaviani (115314079)");
            }
        });
        menuOption.add(help);
        menuOption.add(about);
        this.setJMenuBar(bar);
        jp = new JPanel();
        jp.setSize(400, 400);
        jp.setLayout(null);
        jp.setVisible(true);
        jl = new JLabel(" SELAMAT DATANG DI LOGIN FRAME UTAMA ");
        jl.setFont(new Font("Alergian", 3, 15));
        jl.setBounds(240,0,550,40);
        jl.setVisible(true);
        jp.add(jl);
        this.add(jp);
    }
    public static void main(String[] args) {
        FrameUtama fr = new FrameUtama();
    }
}
